Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed abandoned istanbul webpack loader and replaced it with another #1132

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

matux
Copy link
Contributor

@matux matux commented Mar 3, 2024

Description of the change

This PR replaces the abandoned istanbul-instrumenter-loader with coverage-istanbul-loader.

Both are webpack loaders that use istanbul to instrument js files with istanbul-lib-instrument.

This fixes npm install which was failing with this error:

❯ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/webpack
npm ERR!   dev webpack@"^5.88.2" from the root project
npm ERR!   peer webpack@">=2" from [email protected]
npm ERR!   node_modules/babel-loader
npm ERR!     dev babel-loader@"^8.0.4" from the root project
npm ERR!   4 more (eslint-loader, grunt-webpack, karma-webpack, terser-webpack-plugin)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^2.0.0 || ^3.0.0 || ^4.0.0" from [email protected]
npm ERR! node_modules/istanbul-instrumenter-loader
npm ERR!   dev istanbul-instrumenter-loader@"^3.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^2.0.0 || ^3.0.0 || ^4.0.0" from [email protected]
npm ERR!   node_modules/istanbul-instrumenter-loader
npm ERR!     dev istanbul-instrumenter-loader@"^3.0.1" from the root project

Background

istanbul-instrumenter-loader is incompatible with webpack versions above 4.x, and since it's been abandoned, it lacks support for webpack 5.x.

Other options considered

babel-plugin-istanbul was considered as a modern alternative but since it works at a Babel-level and is not a webpack loader, it was dropped in favor of a webpack-loader solution to keep changes to a minimum ensuring same behavior.

Note on insertions/deletions

Main changes are 2 lines, the rest is package-lock.json.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Maintenance
  • New release

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers assigned
  • Issue from task tracker has a link to this pull request
  • Changes have been reviewed by at least one other engineer

@matux matux requested review from waltjones and mudetroit March 3, 2024 00:16
@matux matux self-assigned this Mar 3, 2024
@matux matux merged commit 6b9f06f into master Mar 6, 2024
4 checks passed
@matux matux deleted the matux/istanbul branch March 6, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants